package com.liusha.quicksand.service.admin;

import com.liusha.quicksand.dao.admin.AdminRepository;
import com.liusha.quicksand.po.Admin;
import com.liusha.quicksand.util.Md5Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 一世长安一世欢
 * @Date: 2020/10/19
 * @Time: 16:32
 * @Description: No Description
 */

@Service
public class AdminServiceImpl implements AdminService {

    @Autowired
    private AdminRepository adminRepository;

    @Override
    public Admin checkAdmin(String username, String password) {
        Admin admin=adminRepository.findByUsernameAndPassword(username, Md5Utils.code(password));

        return admin;
    }
}
